/**
 * 功能描述 导航栏
 */

define(function (require, exports, module) {
	var Subnav = require("subnav");
	var aw = require("ajaxwrapper")
	var visitWay = require("../store/visitway");
    var instance = {
        initComponent: function (params, widget) {
        	var subnav=new Subnav({
        		parentNode:".J-subnav",
				model : {
					title:"访问方式定义",
					items : [{
						id : "add",
						type : "button",
						text:"新增",		
						handler:function(){
							widget.get("form").reset();
							widget.show([".J-form"]).hide([".J-grid"]);
							$("#organization").attr("disabled","disabled")
							widget.get("subnav").hide(["add"]).show(["return"]);							
						}
					},{
						id : "return",
						type : "button",
						text:"返回",						
						show : false,
						handler:function(){
							widget.show([".J-grid"]).hide([".J-form"]);
							widget.get("subnav").hide(["return"]).show(["add"]);
							widget.get("grid").refresh();
						}
					}]
				}
        	});
        	widget.set("subnav",subnav);
        }
    };
    module.exports = instance;
});
